<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
	<title>Atendimento</title>
	<link type="text/css" rel="stylesheet" href="css/estilo.css" />
	<link type="text/css" rel="stylesheet"
		href="css/cupertino/jquery.ui.theme.css" />
</h:head>
<h:body>
<div id="conteudo">
	<!-- Menu -->
	<ui:include src="menu.xhtml" />
	
	
	<h:form id="form1">
		<p:panel id="panel" header="Atendimento">
			<p:messages id="messages" />
			<h:panelGrid columns="2" style="width:500px;">
				<h:outputLabel value="Nome:" />
				<h:outputLabel value="#{atendimentoBean.atendimento.agendamento.paciente.nome} #{atendimentoBean.atendimento.agendamento.paciente.sobrenome}" />
				<h:outputLabel value="CPF:" />
				<h:outputLabel value="#{atendimentoBean.atendimento.agendamento.paciente.cpf}" />
				<h:outputLabel value="Convênio:" />
				<h:outputLabel value="#{atendimentoBean.atendimento.agendamento.convenio.descricao}" />
				
				<h:outputText value="Tratamento(s): " />  
	        	<p:selectManyMenu value="#{atendimentoBean.tratamentosSelecionados}" style="height:150px;width:200px;">  
		        	<f:selectItems value="#{atendimentoBean.tratamentos}" var="tratamento" itemLabel="#{tratamento.descricao}" itemValue="#{tratamento.id}" />
		        </p:selectManyMenu>
		        
		        <h:outputText value="Medicamento(s): " />  
	        	<p:selectManyMenu value="#{atendimentoBean.medicamentosSelecionados}" style="height:150px;width:200px;">  
		        	<f:selectItems value="#{atendimentoBean.medicamentos}" var="remedio" itemLabel="#{remedio.descricao}" itemValue="#{remedio.id}" />
		        </p:selectManyMenu>
		        
				<p:commandButton value="Cancelar" update="panel" id="btnCancelar" actionListener="#{atendimentoBean.limpaForm}" />
				<p:commandButton value="Salvar"   update="@form" id="btnSalvar"   actionListener="#{atendimentoBean.grava}" />
			</h:panelGrid>
		</p:panel>
	</h:form>
	
</div>
</h:body>	
</html>